package cn.swing.his.finance.webapi.mapper;

import cn.swing.his.pojo.finance.entity.FinanceForm;
import cn.swing.his.pojo.finance.vo.FinanceFormVO;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

@Repository
public interface FinanceFormMapper {
    /**
     * 获取所有申请表
     * @return
     */
    List<FinanceFormVO> financeFormList();

    /**
     * 通过审批
     */
    int updateFinanceFormState(@Param("id") Integer id, @Param("state") Integer state);
    /**
     * 修改审批时间为当前时间
     * @param id
     * @param dealTime
     */
    void updateFinanceDealTime(Integer id, LocalDateTime dealTime);

    /**
     * 添加审批表
     */
    int insertFinanceForm(FinanceForm financeForm);

    /**
     * 根据id判读昂当前表单状态
     * @param id
     * @return
     */
    Integer getFormState(Integer id);

    /**
     * 根据人名找到当前医生id
     * @param doctorName
     * @return
     */
    Integer getDoctorIdByName(String doctorName);
//根据当前索引找到对应状态
    List<FinanceFormVO> financeFormListByState(Integer index);
}
